package com.hehe.controller;


import com.hehe.Dao.Delete_mapper;
import com.hehe.Dao.Test_Mapper;
import com.hehe.POJO.Tb_slang;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping(value="/delete")
public class Delete {

    @Autowired
    private Delete_mapper delete_mapper;

    @PostMapping(value = "/delete_this_slang")
    @ResponseBody
    public String delete(Model model, @RequestBody String json_data) throws JSONException {
        JSONObject jsonobj = new JSONObject(json_data);
        String id = (String) jsonobj.get("id");
        Integer integer = delete_mapper.delete_this_slang(id);
        return "success";
    }


}




